﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CustomAlbumListDetail.ascx.cs" Inherits="admin_webparts_Plug_ins_CommonPage_CustomAlbumListDetail" %>

<%@ Import Namespace="NTTHAO.Web.BL.CommonPage" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>

<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("CUSTOM_ALBUM_LIST_INFO", Session)%></h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>

<%if (this._CustomList != null)
  { %>
<table cellspacing="0" cellpadding="3" border="1" class="grid" style="margin: 10px auto;">
    <tr class="even">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("NAME", Session)%>:
        </td>
        <td><b><%=this._CustomList.Name%></b>
        </td>
    </tr>
    <tr class="odd">
        <td align="right" width="200px">
            <%=LanguageUtility.GetLanguageText("ALBUM_LIMIT", Session)%>:
        </td>
        <td><%=this._CustomList.AlbumLimit%></td>
    </tr>
</table>
<div class="tip">
	<h2 style="padding-top: 0px;"><%=LanguageUtility.GetLanguageText("ALBUM_LIST", Session)%></h2>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<%if (this._List == null || this._CustomList.AlbumLimit > this._List.Rows.Count)
  {  %>
	<tr>
        <td align="left" style="padding-bottom: 10px;">
            <span id="addLink" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddp"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=adalbum&listid=<%=this._CustomList.ID %>" tabindex="0" id="loggerLink-button"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
            <script type="text/javascript">
                YAHOO.util.Event.onContentReady("addLink", function () {
                        var oAddLink = new YAHOO.widget.Button("addLink");
                    });
            </script>
        </td>
    </tr>
<%}
  else
  { %>
    <tr>
        <td align="left"><div style="color: mediumblue; background-color: moccasin; padding: 10px; margin-bottom: 10px;">Số dự án đã đủ. Muốn thêm dự án khác, vui lòng xóa dự án hiện tại trước.</div></td>
    </tr>
<%} %>
    <tr>
        <td align="left">
            <table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
                <tr>
                    <th width="42px">#</th>
                    <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("PRESENTATIVE_IMAGE", Session)%></th>
                    <th width="42px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
                </tr>
    <%if (this._List != null) for (int i = 0; i < this._List.Rows.Count; i++)
          {
              System.Data.DataRow row = this._List.Rows[i]; %>
    <tr class="<%=(i%2==1?"even":"odd") %>">
        <td align="center"><%=i + 1 %></td>
        <td align="left"><b><%=row[CommonAlbum.ALBUMNAME__COLUMN_NAME] %></b></td>
        <td align="center">
            <a href="../<%=row[CommonAlbum.IMAGEPATH__COLUMN_NAME].ToString() + row[CommonAlbum.IMAGE__COLUMN_NAME].ToString()%>" target="_blank">
                <img src="../<%=row[CommonAlbum.IMAGEPATH__COLUMN_NAME].ToString() + "Mini_" + row[CommonAlbum.IMAGE__COLUMN_NAME].ToString()%>" alt="" style="max-width: 100px; max-height: 75px;" />
            </a>
        </td><td align="left">
            <ul class="icon" style="width: 84px;">
                <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=delalbum&listid=<%=this._CustomList.ID %>&id=<%=row["DetailID"] %>" class="icon deletebn" onclick="javascript: return confirmDelete();">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=moveupalbum&listid=<%=this._CustomList.ID %>&id=<%=row["DetailID"] %>" class="icon ascbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=movealbumdown&listid=<%=this._CustomList.ID %>&id=<%=row["DetailID"] %>" class="icon descbn">&nbsp</a></li>
            </ul>
        </td>
    </tr>
    <%} %>
            </table>
        </td>
    </tr>
</table>
<%} %>
<script type="text/javascript">
    function confirmDelete() {
        var msg = '<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace(Environment.NewLine, "<br />")%>';
        return confirm(msg.replace(/<br \/>/gi, "\r\n").replace(/<br\/>/gi, "\r\n"));
    }
</script>